package com.wxp.controller.mall;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wxp.controller.BaseController;
import com.wxp.service.StatisticsService;
import com.wxp.util.IData;

@Controller
@RequestMapping(value = "/search")
public class SearchController extends BaseController {
	@Autowired
	private StatisticsService statisticsService;

	@RequestMapping(value = "/fetchSummary")
	@ResponseBody
	public Object fetchSummary() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchSummary(pd);
		return datas;
	}
	@RequestMapping(value = "/fetchSummaryFever")
	@ResponseBody
	public Object fetchSummaryFever() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchSummaryFever(pd);
		return datas;
	}
	@RequestMapping(value = "/fetchStatisticswc")
	@ResponseBody
	public Object fetchStatisticswc() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchStatisticswc(pd);
		return datas;
	}
	@RequestMapping(value = "/fetchStatisticshh")
	@ResponseBody
	public Object fetchStatisticshh() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchStatisticshh(pd);
		return datas;
	}
	@RequestMapping(value = "/fetchStatisticsfg")
	@ResponseBody
	public Object fetchStatisticsfg() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchStatisticsfg(pd);
		return datas;
	}
	
	@RequestMapping(value = "/fetchWorkTrend")
	@ResponseBody
	public Object fetchWorkTrend() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchWorkTrend(pd);
		return datas;
	}
	@RequestMapping(value = "/fetchReport")
	@ResponseBody
	public Object fetchReport() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchReport(pd);
		return datas;
	}
	
	@RequestMapping(value = "/fetchOutReturnWork")
	@ResponseBody
	public Object fetchOutReturnWork() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchOutReturnWork(pd);
		return datas;
	}
	
	@RequestMapping(value = "/fetchYqqs")
	@ResponseBody
	public Object fetchYqqs() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.fetchYqqs(pd);
		return datas;
	}
	
	@RequestMapping(value = "/getPxInfo")
	@ResponseBody
	public Object getPxInfo() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.getPxInfo(pd);
		return datas;
	}
	
	
	/**
	 * 地图展示员工分布
	 * @return
	 * @throws Exception
	 */
	@RequestMapping(value = "/mapdata")
	@ResponseBody
	public Object mapData() throws Exception {
		IData pd = IData.getInstance(request);
		List<IData> datas = statisticsService.mapdata(pd);
		return datas;
	}

	
}
